Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto translate date format based on current i18n Locale #673

Merged
merged 2 commits into from
Jun 21, 2023

Conversation

Gavinok
Copy link
Collaborator

@Gavinok Gavinok commented Jun 20, 2023

Resolves #593 the solution simply translates the i18n locale to the corresponding local supported by date-fns. I created a new type that is also used in the LocaleSwitcher to ensure that when ever a new i18n locale is added the corresponding translation is also implemented.

To better enforce this the conversion function will throw an exception. This is only necessary to handle cases where _dateFnsFormat is used outside of a vue component (which is likely never)

image

image

image

Signed-off-by: Gavin <gavinfreeborn@gmail.com>
Signed-off-by: Gavin <gavinfreeborn@gmail.com>
@Gavinok Gavinok requested review from loneil and amanji June 20, 2023 20:11
@Gavinok Gavinok temporarily deployed to development June 20, 2023 20:20 — with GitHub Actions Inactive
@github-actions
Copy link

@Gavinok Gavinok changed the title Auto translate date formate based on current i18n Locale Auto translate date format based on current i18n Locale Jun 20, 2023
@loneil loneil merged commit 6f5cb57 into main Jun 21, 2023
@loneil loneil temporarily deployed to development June 21, 2023 21:22 — with GitHub Actions Inactive
@loneil loneil deleted the localize-formatted-dates-tenant-ui branch July 18, 2023 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Localize formatted dates in TenantUI
2 participants